3.19 \(\int \frac {\csc (x)}{a+b \cot (x)} \, dx\)

Optimal. Leaf size=36 \[ -\frac {\tanh ^{-1}\left (\frac {\sin (x) (a \cot (x)-b)}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}} \]

[Out]

-arctanh((-b+a*cot(x))*sin(x)/(a^2+b^2)^(1/2))/(a^2+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3509, 206} \[ -\frac {\tanh ^{-1}\left (\frac {\sin (x) (a \cot (x)-b)}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}} \]

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(a + b*Cot[x]),x]

[Out]

-(ArcTanh[((-b + a*Cot[x])*Sin[x])/Sqrt[a^2 + b^2]]/Sqrt[a^2 + b^2])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3509

Int[sec[(e_.) + (f_.)*(x_)]/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Dist[f^(-1), Subst[Int[1/(a^
2 + b^2 - x^2), x], x, (b - a*Tan[e + f*x])/Sec[e + f*x]], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {\csc (x)}{a+b \cot (x)} \, dx &=-\operatorname {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,(-b+a \cot (x)) \sin (x)\right )\\ &=-\frac {\tanh ^{-1}\left (\frac {(-b+a \cot (x)) \sin (x)}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 38, normalized size = 1.06 \[ \frac {2 \tanh ^{-1}\left (\frac {b \tan \left (\frac {x}{2}\right )-a}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(a + b*Cot[x]),x]

[Out]

(2*ArcTanh[(-a + b*Tan[x/2])/Sqrt[a^2 + b^2]])/Sqrt[a^2 + b^2]

________________________________________________________________________________________

fricas [B]  time = 0.83, size = 98, normalized size = 2.72 \[ \frac {\log \left (-\frac {2 \, a b \cos \relax (x) \sin \relax (x) - {\left (a^{2} - b^{2}\right )} \cos \relax (x)^{2} - a^{2} - 2 \, b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (a \cos \relax (x) - b \sin \relax (x)\right )}}{2 \, a b \cos \relax (x) \sin \relax (x) - {\left (a^{2} - b^{2}\right )} \cos \relax (x)^{2} + a^{2}}\right )}{2 \, \sqrt {a^{2} + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cot(x)),x, algorithm="fricas")

[Out]

1/2*log(-(2*a*b*cos(x)*sin(x) - (a^2 - b^2)*cos(x)^2 - a^2 - 2*b^2 + 2*sqrt(a^2 + b^2)*(a*cos(x) - b*sin(x)))/
(2*a*b*cos(x)*sin(x) - (a^2 - b^2)*cos(x)^2 + a^2))/sqrt(a^2 + b^2)

________________________________________________________________________________________

giac [A]  time = 0.47, size = 61, normalized size = 1.69 \[ -\frac {\log \left (\frac {{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cot(x)),x, algorithm="giac")

[Out]

-log(abs(2*b*tan(1/2*x) - 2*a - 2*sqrt(a^2 + b^2))/abs(2*b*tan(1/2*x) - 2*a + 2*sqrt(a^2 + b^2)))/sqrt(a^2 + b
^2)

________________________________________________________________________________________

maple [A]  time = 0.18, size = 35, normalized size = 0.97 \[ \frac {2 \arctanh \left (\frac {2 \tan \left (\frac {x}{2}\right ) b -2 a}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(a+b*cot(x)),x)

[Out]

2/(a^2+b^2)^(1/2)*arctanh(1/2*(2*tan(1/2*x)*b-2*a)/(a^2+b^2)^(1/2))

________________________________________________________________________________________

maxima [A]  time = 1.88, size = 61, normalized size = 1.69 \[ -\frac {\log \left (\frac {a - \frac {b \sin \relax (x)}{\cos \relax (x) + 1} + \sqrt {a^{2} + b^{2}}}{a - \frac {b \sin \relax (x)}{\cos \relax (x) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cot(x)),x, algorithm="maxima")

[Out]

-log((a - b*sin(x)/(cos(x) + 1) + sqrt(a^2 + b^2))/(a - b*sin(x)/(cos(x) + 1) - sqrt(a^2 + b^2)))/sqrt(a^2 + b
^2)

________________________________________________________________________________________

mupad [B]  time = 0.28, size = 31, normalized size = 0.86 \[ -\frac {2\,\mathrm {atanh}\left (\frac {a-b\,\mathrm {tan}\left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)*(a + b*cot(x))),x)

[Out]

-(2*atanh((a - b*tan(x/2))/(a^2 + b^2)^(1/2)))/(a^2 + b^2)^(1/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc {\relax (x )}}{a + b \cot {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cot(x)),x)

[Out]

Integral(csc(x)/(a + b*cot(x)), x)

________________________________________________________________________________________